﻿
using System;
using System.IO;
using System.Text;

namespace motion
{
	/// <summary>
	/// Description of ErrorHandler.
	/// </summary>
	public class ErrorHandler
	{
		private static ErrorHandler _instance = new ErrorHandler();
		
		private ErrorHandler() {}
		
		public static ErrorHandler Instance
		{
			get
			{
				return _instance;
			}
		}
		
		public void WriteError(Exception e)
		{
			StringBuilder message = new StringBuilder();
			message.Append(DateTime.Now);
			message.Append("\t");
			message.Append(e.ToString());
			
			File.AppendAllText("log.txt", message.ToString());
		}
	}
}
